<?php

use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::middleware('auth:api')->get('/user', function (Request $request) {
    return $request->user();
});
Route::middleware('auth:api')->post('/aaa/ggg/article', 'ArticleController@addArticle', function (Request $request) {
    return $request->user();
});
Route::post('article/{id}', 'ArticleController@addArticle', function (Request $request) {
    return $request->user();
});

Route::any('login/show', 'LoginController@show');

Route::prefix('v1')->group(function () {
    Route::match(['post', 'get'], 'dd', 'ApiController@index');
    Route::match(['post', 'get'], 'test', 'ApiController@test');
});
Route::namespace('Api')->prefix('v1/article')->group(function () {
    Route::post('like', 'ArticleController@like');
    Route::get('list', 'ArticleController@getArticle');
});

